<template>
	<view class="service" v-if="phone">
		<view class="contetn ">
			<view class="my_flex">
				<view style="margin-right: 23rpx;">
					<image class="ikon" :src="IMGURL+'/wx/ikon.png'" mode=""></image>	
				</view>
				<view class="rr">
					<image class="serve" :src="IMGURL+'/wx/service.png'" mode=""></image>	
					<view>
						{{phone}}
					</view>
				</view>
			</view>
			<view class="btn" @click="callPhone">
				一键拨号
			</view>
		</view>
		<image @click="closeMarsk" class="close" :src="IMGURL+'/wx/close.png'"></image>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				phone:''
			}
		},
		created() {
			this.getPhone()
		},
		methods:{
			getPhone(){
				this.$api.user.servicephone().then(res=>{
					this.phone = res.data.phone
				})
			},
			callPhone(){
				uni.makePhoneCall({
					phoneNumber:this.phone
				})
			},
			closeMarsk(){
				this.$emit('closeMarsk')
			},
		}
	}
</script>

<style lang="scss" scoped>
	.service{
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0,0,0,.4);
		padding-top: 350rpx;
		.contetn{
			width: 600rpx;
			height: 390rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			margin: 0 auto;
			box-sizing: border-box;
			padding: 0 33rpx 41rpx 21rpx;
			.ikon{
				width: 213rpx;
				height: 256rpx;
			}
			.serve{
				width: 184rpx;
				height: 84rpx;
				margin: 0 auto;
				margin-bottom: 30rpx;
			}
			.rr{
				flex: 1;
				padding-top: 74rpx;
				text-align: center;
				font-weight: bold;
				font-size: 40rpx;
			}
			.btn{
				width: 412rpx;
				height: 70rpx;
				background: #FFDE47;
				border-radius: 35rpx;
				text-align: center;
				line-height: 70rpx;
				margin: 27rpx auto 0;
			}
		}
		.close{
			width: 88rpx;
			height: 88rpx;
			margin: 58rpx auto;
		}
	}
</style>